package com.gwtjs.icustom.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.gwtjs.icustom.entity.ResultWrapper;
import com.gwtjs.icustom.mapper.UserMapper;
import com.gwtjs.icustom.pojo.User;

/**
 * 登陆，也是首页
 * @author flash
 *
 */
@RestController @RequestMapping("/user")
public class LoginController {

	@Autowired
	private UserMapper userMapper;

	@GetMapping("/login")
	public ResultWrapper login(@RequestBody User u) {
		User user = userMapper.queryByUser(u);
		return ResultWrapper.constructSuccessResult(user);

	}

}
